new Vue({
    el: "#app",
    data() {
        return{
            registerForm:{
                username:'',
                password:'',
                sex:'',
                address:''
            }
        }
    },
    methods:{
        registerBtn(){
            $.ajax({
                url: "/user/addUser",
                data: {
                    "username" : this.username,
                    "password" : this.password,
                    "sex" : this.sex,
                    "address" : this.address
                },
                dataType: "json",
                success:function (res) {
                    if (res.status){
                        lightyear.url("/user/toLogin")
                        lightyear.notify(res.msg,"success","1000","mdi mdi-checkbox-marked-circle");
                    }else {
                        lightyear.notify(res.msg,"danger","1000","mdi mdi-checkbox-marked-close");
                    }
                }
            });
        }
    },
});
